Ext.define('Seq.app.ChartPanelController', {
    extend: 'Seq.app.BaseController',

    alias: 'controller.chartpanelcontroller',

    getExtraParams(params) {
        let me = this, vm = me.getViewModel();
        params = me.callParent(arguments);
        me.appliesIf(params.params, vm, ['interval', 'period']);
        return params;
    },

    onRefreshData(view, record, params, opts) {
        let p = {};
        p.params = params || {};
        let me = this, chart = view.down('echartsbase');
        Ext.applyIf(p, chart.echartUrl || chart.url);
        chart.updateUrl(me.getExtraParams(p));
    }
})